﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace RM.Common
{
    public class CustomTree
    {
        private int _id;
        private int _parentmenuId;
        private string _moduleName;
        private string _title;
        
        public int Id
        {
            get { return _id; }
            set { _id = value; }
        }
        public int ParentMenuId
        {
            get { return _parentmenuId; }
            set { _parentmenuId = value; }
        }
        public string ModuleName
        {
            get { return _moduleName; }
            set { _moduleName = value; }
        }
        public string Title
        {
            get { return _title; }
            set { _title = value; }
        }
        /// <summary>
        /// 在模拟数的Grid中使用
        /// </summary>
        private int treeLevel = 0;
        /// <summary>
        /// 是Tree中使用
        /// </summary>
        private bool isTreeLeaf = false;
        /// <summary>
        /// 在模拟数的下拉列表中使用
        /// </summary>
        private bool enabled = true;
        /// <summary>
        /// 本菜单在树形结构中层级（从0开始）
        /// </summary>
        public int TreeLevel
        {
            get { return treeLevel; }
            set { treeLevel = value; }
        }
        /// <summary>
        /// 是否可用（默认true）
        /// </summary>
        public bool Enabled
        {
            get { return enabled; }
            set { enabled = value; }
        }

        /// <summary>
        /// 是否叶子节点（默认false）
        /// </summary>
        public bool IsTreeLeaf
        {
            get { return isTreeLeaf; }
            set { isTreeLeaf = value; }
        }
        public CustomTree()
        { }
        protected CustomTree(CustomTree tree)
        {
            Id = tree.Id;
            ParentMenuId = tree.ParentMenuId;
            ModuleName = tree.ModuleName;
            Title = tree.Title;

            TreeLevel = tree.TreeLevel;
            IsTreeLeaf = tree.IsTreeLeaf;
            Enabled = tree.Enabled;
        }
    }
}